package com.asp.alumnisystem.presenter;

import com.asp.alumnisystem.app.App;
import com.asp.alumnisystem.base.BaseBean;
import com.asp.alumnisystem.base.BasePresenter;
import com.asp.alumnisystem.base.IView;
import com.asp.alumnisystem.model.DetailsModel;
import com.asp.alumnisystem.model.PageModel;
import com.asp.alumnisystem.net.RetrofitManager;

import java.util.List;

import io.reactivex.Observable;

/**
 *  请求帖子评论信息的Presenter
 */
public class DetailsPresenter extends BasePresenter<PageModel, List<DetailsModel>> {

    private Long forumId;

    public DetailsPresenter(IView view, Long forumId) {
        super(view);
        this.forumId = forumId;
    }

    @Override
    protected Observable<BaseBean<List<DetailsModel>>> requestNet(PageModel pageModel){
        return RetrofitManager.getApi().getDetailList(App.getApp().getUserId(), forumId, pageModel.getNowPage(), pageModel.getPageSize());
    }

}
